#
# @lc app=leetcode.cn id=27 lang=python
#
# [27] 移除元素
#

# @lc code=start
class Solution(object):
    def removeElement(self, nums, val):
        """
        :type nums: List[int]
        :type val: int
        :rtype: int
        """
        while val in nums:
            nums.remove(val)
        print(nums)
        return len(nums)
# @lc code=end

if __name__ == "__main__":
    solution = Solution()
    length = solution.removeElement([0, 1, 2, 2, 3, 0, 4, 2], 2)
    print(length)